package com.outstanding.junit.enums;

import com.outstanding.framework.core.BaseEnum;

public enum EnableDisableType implements BaseEnum<EnableDisableType,String>{
	
	ENABLE("1", "启用"), 
	DISABLE("2", "禁用");

	private String code;

	private String name;

	private EnableDisableType(String code, String name) {
		this.code = code;
		this.name = name;
	}

	/**
	 * 根据code获取对应枚举
	 * @param code
	 * @return
	 */
	public static EnableDisableType getByCode(String code) {
		EnableDisableType[] array = EnableDisableType.values();
		for (EnableDisableType bd : array) {
			if (bd.getCode().equals(code)) {
				return bd;
			}
		}
		return null;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
